package com.uplooking.dao;

import com.uplooking.daomain.UserBean;
import com.uplooking.util.C3p0Jdbc;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class UserDao {
    public List<UserBean> getUser(String strValue) throws SQLException {
        C3p0Jdbc c3p0Jdbc=new C3p0Jdbc();
        QueryRunner queryRunner=c3p0Jdbc.getConn();
        List<UserBean> users = (List<UserBean>)queryRunner.query("select * from users where username="+"'"+strValue+"'", new BeanListHandler(UserBean.class));
        return users;
    }
}
